<template>
	<view>
		<!-- 实现log打印 -->
		<button @click="onLog()">console.log</button>
		<button @click="onDebug()">console.debug</button>
		<button @click="oninfo()">console.info</button>
		<button @click="onwarn()">console.warn</button>
		<button @click="onError()">console.error</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '打印日志',
				name:'lh',
				pwd:'222'
			}
		},
		methods: {
			onLog() {
				// 常规写法
				console.log("onLog()-->" + this.title);
				console.log("clog");
				console.log('this,title: ', this, title);
				console.log('this.title: ' + this.title);
			},
			onwarn(){
				if(name==='lh'){
					console.log("登陆验证成功");
				}else{
					console.warn("this is warn log")
				}
			},
			onError(){
				console.error("this is error message");
				try{
					//..
				}catch(e){
					console.error("catch")
				}
			}
		}
	}
</script>

<style>

</style>